#pragma once

#include <QWidget>
#include <QVideoWidget>
#include <QMediaPlayer>
#include "ui_Pacs_Left_TopWidget.h"
#include <QCameraImageCapture>
#include <QCamera>
#include <QCameraViewfinder>
#include <QTimer>
#include <QMenu>
#include <QMediaRecorder>
#include "qcamerainfo.h"
#include <opencv2/core/core.hpp>
#include <QTimer>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/opencv.hpp>
#include <opencv2/imgproc/imgproc.hpp>
using  namespace cv;

typedef struct  
{
	QString strCameraName;
	int  cameraIndex;
}cameraIndfo;

class Pacs_Left_TopWidget : public QWidget
{
	Q_OBJECT

public:
	Pacs_Left_TopWidget(QWidget *parent = Q_NULLPTR);
	~Pacs_Left_TopWidget();
private slots:
	void slotTimer();
	void displayImage(int, QImage image);
	void on_btn_set_clicked();
	void updateCameraDevice(QAction *action);
	void processCapturedImage(int, QImage);
	void on_btn_caiji_clicked();
	void on_btn_linkVideo_clicked();
	void on_btn_luxiang_clicked();
	void on_btn_stop_clicked();
	void updateImage();
	void startTimer();
public:
	void setCamera(int);
	void setRecodetime();

signals:
	void captureImg(const QImage& image,const QString& strImagePath);
	void newVideo(const QString& strVideoPath);
	void canStart();
private:
	QString getDefaultCamera();
private:
	Ui::Pacs_Left_TopWidget ui;
	QTimer							*m_theTimer;
	Mat								m_srcImage;
	VideoCapture				m_videoCap;
	VideoWriter					m_videoWriter;
	QString							m_strDefaultCamera;
	int								m_currentCameraIndex;
	QMenu							*m_pPreMenu;
	bool m_haveCameDevice;
	QString						  m_currentVideoPath;
	bool isRecoder;
	int m_hour;
	int m_minute;
	int m_second;
	int m_timerCount;
	bool m_showRadius;
	double m_fps;
	

	
};
